<?

// $d = component_data($c); 
$s = component_settings($c);

//debug($s);
//debug($d);	

if ($s['bc_mode']) {

	
		switch($s['bc_mode']) {
	
			case 2:

				if ((int)$s['bc_starting'] < sizeof($GLOBALS['DATA']['crumb'])) {
					?><nav id="cpn-<?=$c?>-bc" class="cpn-page-nav-bc"><?
				}
				
				//debug((int)$s['bc_starting']);
				//debug(sizeof($GLOBALS['DATA']['crumb'])); 
				
					if ( sizeof($GLOBALS['DATA']['crumb']) - (int)$s['bc_starting']  >  1) {  
				
						for ($i = (int)$s['bc_starting']; $i < sizeof($GLOBALS['DATA']['crumb']); $i++) {
							$cr = $GLOBALS['DATA']['crumb'][$i];
							
							if ($cr['last']) {
								
								?><?=$sep?><span class="current"><?=t($cr['name'])?></span><?
								
							} else {
					
								?><?=$sep?><a href="<?=$cr['path']?>" title="<?=$cr['name']?>"><?=$cr['name']?></a><?
					
							}
							
							$sep='&nbsp;'.$s['bc_sep'].'&nbsp;';
						}
						
					}
					
					
					
				
				
				
				if ((int)$s['bc_starting'] < sizeof($GLOBALS['DATA']['crumb'])) {
					?></nav><?
				}
				
				break;
		}
	
}

if ($s['nav_mode']) {

	switch($s['nav_mode']) {

		case 3:
			$id = dat('page', 'id');
			
			if (sizeof($GLOBALS['DATA']['crumb']) > $s['nav_starting']) {

				?><nav id="cpn-<?=$c?>-nav" class="cpn-page-nav-nav"><ul><?
					include bit('basic/main-menu/user', 'html', array('levels' => $s['nav_deep'], 'parent' => dat('page', 'id'),
								'filter' => ($CONTEXT['lang'] == 'en') ? PTC_1 : 0));
				?></ul></nav><?
			}

			break;
		
	}
}

unstack();
